<%-- 
    Document   : danhmuctheoloai
    Created on : Oct 7, 2011, 5:27:52 PM
    Author     : Rocker000
--%>

<%@page import="dao.ThuongHieu_dao"%>
<%@page import="pojo.ThuongHieu_pojo"%>
<%@page import="dao.LoaiSanPham_dao"%>
<%@page import="pojo.LoaiSanPham_pojo"%>
<%@page import="java.util.ArrayList"%>
<%@page import="dao.DanhMuc_dao"%>
<%@page import="pojo.DanhMuc_pojo"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%String madanhmuc=request.getParameter("madanhmuc");%>
<!--lấy danh muc theo ma-->
<%DanhMuc_pojo dm = DanhMuc_dao.LayDanhMuc(madanhmuc);%>

<!--lay danh sach loai san pham-->
<%ArrayList<LoaiSanPham_pojo> ds =LoaiSanPham_dao.LayDanhSach(madanhmuc); %>
<%
String action = "hienthidanhsachtheoloaisanpham";
String mathuonghieu=""; 
String maloaisanpham="";
if(request.getAttribute("mathuonghieu")!=null)
{
    mathuonghieu = String.valueOf(request.getAttribute("mathuonghieu"));
    action="laysanphamtheothuonghieuvadanhmuc";
}
%>
<%ArrayList<ThuongHieu_pojo> ds_thuonghieu = ThuongHieu_dao.LayDanhSachTheoDanhMuc(madanhmuc) ;
if(request.getParameter("maloaisanpham")!=null){maloaisanpham=String.valueOf(request.getParameter("maloaisanpham"));ds_thuonghieu=ThuongHieu_dao.LayDanhSachTheoLoaiSanPham(String.valueOf(request.getParameter("maloaisanpham")));}
%> 



<table width="100%" border="0" background="Image/left.jpg">
    <!--show danh sách loai san pham-->
          <tr>
            <td valign="top">                                         
            <strong><font color ="red"><%=dm.getTenDanhMuc() %> </font></Strong>
                      
                <ul>
<%for(int i=0;i<ds.size();i++){%> 
<%String href="sanpham_controller?action="+action+"&&madanhmuc="+ds.get(i).getMaDanhMuc()+"&&maloaisanpham="+ds.get(i).getMaLoaiSanPham()+"&&mathuonghieu="+mathuonghieu+"&&maloaisanpham="+maloaisanpham+" "; %>
                  <a href=<%=href %> >
                      <li><%=ds.get(i).getTenLoaiSanPham() %></li> 
                  </a>          
 <%}%>                                                                                           
                </ul>        
            </td>            
          </tr>
     <!--end show-->     
          
      <!--Phan loai theo thuong hieu-->
          <tr>
              <td>
                  <strong><font color ="red">Theo Thương Hiệu </font></Strong>
                  
                      <ul>
                          <%for(int i =0;i<ds_thuonghieu.size();i++){ThuongHieu_pojo th =ds_thuonghieu.get(i); %>
                          <%String href_sanpham_controller = "sanpham_controller?action=laysanphamtheothuonghieuvadanhmuc&&madanhmuc="+madanhmuc; 
                          if(request.getParameter("maloaidanhmuc")!=null){href_sanpham_controller="sanpham_controller?action=laysanphamtheothuonghieuvaloaisanpham&&maloaisanpham="+request.getParameter("maloaisanhpham");}
                          %>
                          <a href="sanpham_controller?action=laysanphamtheothuonghieuvadanhmuc&&madanhmuc=<%=dm.getMaDanhMuc() %>&&mathuonghieu=<%=th.getMaThuongHieu() %>">
                          <li><%=th.getTenThuongHieu() %></li>
                          </a>
                          <%}%>
                      </ul>
              </td>
          </tr>
      <!--ket thúc-->
      
      <!--phân loại theo giá-->
      <tr>
          <td>
              <strong><font color ="red">Theo Giá </font></Strong>
              <ul>
                  <a href="sanpham_controller?action=laydanhsachsanphamtheogia&&begin=0&&end=1&&madanhmuc=<%=dm.getMaDanhMuc()%>">
                    <li>dưới 1tr</li>
                  </a>
                  <a href="sanpham_controller?action=laydanhsachsanphamtheogia&&begin=1&&end=2.9&&madanhmuc=<%=dm.getMaDanhMuc()%>">
                    <li>1tr - 2,9tr</li>
                  </a>
                  
                  <a href="sanpham_controller?action=laydanhsachsanphamtheogia&&begin=3&&end=4.9&&madanhmuc=<%=dm.getMaDanhMuc()%>">
                    <li>3tr - 4,9tr</li>
                  </a>
                  
                  <a href="sanpham_controller?action=laydanhsachsanphamtheogia&&begin=5&&end=9.9&&madanhmuc=<%=dm.getMaDanhMuc()%>">
                    <li>5tr - 9,9tr</li>
                  </a>
                  
                  <a href="sanpham_controller?action=laydanhsachsanphamtheogia&&begin=10&&end=19.9&&madanhmuc=<%=dm.getMaDanhMuc()%>">
                    <li>10tr - 19,9tr</li>
                  </a>
                  
                  <a href="sanpham_controller?action=laydanhsachsanphamtheogia&&begin=20&&end=39.9&&madanhmuc=<%=dm.getMaDanhMuc()%>">
                    <li>20tr - 39,9tr</li>
                  </a>
                  
                  <a href="sanpham_controller?action=laydanhsachsanphamtheogia&&begin=40&&end=100&&madanhmuc=<%=dm.getMaDanhMuc()%>">
                    <li>Cao hơn 40tr</li>
                  </a>
              </ul>
          </td>              
      </tr>
      <!--kết thúc-->
            
      <!--Phan loại theo size-->
<%if(request.getParameter("maloaisanpham")!=null){ %>      
      <tr>
          <td>
              <strong><font color ="red">Theo size </font></Strong>              
              <ul>
                  <a href="">
                    <li>dfsdkfj</li>
                  </a>
              </ul>              
          </td>
      </tr>
<%}%>      
      <!--kết thúc-->
      
      
      <!--phân loại theo tieu chi khac-->
      <tr>
          <td>
              <strong><font color ="red">Theo loại </font></Strong>
              <ul>
                  <a href="">
                      <li>Sản phẩm bán chạy</li>
                  </a>
                  
                  <a href="">
                      <li>Sản phẩm hot nhât</li>
                  </a>
                  
                  <a href="">
                      <li>Sản phẩm mới</li>
                  </a>
                  
                  <a href="">
                      <li>Sản phảm gảm giá</li>
                  </a>                                                      
                  
              </ul>
          </td>              
      </tr>
      <!--kết thúc-->
      
</table>
